<template>
  <div id="user">
    <h2>用户id ------- {{this.$route.params.id}}</h2>
  </div>
</template>

<script>
import {useRoute} from 'vue-router'
export default {
  name: "User",
  setup(){
    const route = useRoute()
    console.log(route.params)
  }
}
</script>

<style scoped>
#user {
  width: 450px;
  height: 600px;
  background-color: skyblue;
}
</style>